<html>
<head><meta charset="utf-8"><title>Add placement by return (GCE, unsized retu compiler-team#330 · t-compiler/major changes · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/index.html">t-compiler/major changes</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html">Add placement by return (GCE, unsized retu compiler-team#330</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="202934541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202934541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202934541">(Jul 05 2020 at 19:24)</a>:</h4>
<p>A new proposal has been announced: <a href="https://github.com/rust-lang/compiler-team/issues/330">#330</a>. It will be<br>
                announced at the next meeting to try and draw attention to it,<br>
                but usually MCPs are not discussed during triage meetings. If<br>
                you think this would benefit from discussion amongst the<br>
                team, consider proposing a design meeting.</p>



<a name="202934837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202934837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202934837">(Jul 05 2020 at 19:34)</a>:</h4>
<p>That looks like a language MCP in the wrong repo</p>



<a name="202935340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202935340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202935340">(Jul 05 2020 at 19:47)</a>:</h4>
<p>It seems like two MCPs to me, one of which is a lang feature (support for unsized return values) and the other could be appropriate for T-compiler in principle (implementation side, at least as far as it applies to <em>sized types</em>) but quite under-specified: placement of sized types is claimed to be one of the consequences, but I don't see anything addressing the core implementation issue of how we can "guarantee" to avoid large temporaries in MIR/LLVM IR/machine code.</p>



<a name="202936853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202936853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gary Guo <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202936853">(Jul 05 2020 at 20:26)</a>:</h4>
<p>I believe we'd better implement copy elision for sized places before we even experiment unsized return types. Copy elision is minor while the proposed solution for unsized return types seems a major change.</p>



<a name="202937393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202937393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202937393">(Jul 05 2020 at 20:40)</a>:</h4>
<p>I would not call copy elision "minor"; properly implementing it (and understanding the scope and limitations) seems like a full compiler MCP all on its own. Which is why I'm honestly a bit disappointed by this MCP, it glosses over that (important) topic.</p>



<a name="202937867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202937867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gary Guo <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202937867">(Jul 05 2020 at 20:54)</a>:</h4>
<p>It is certainly not minor for the compiler implementation but it is waaaay less major than the unsized return part!</p>



<a name="202939029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202939029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202939029">(Jul 05 2020 at 21:28)</a>:</h4>
<p>The <a href="https://github.com/PoignardAzur/placement-by-return/blob/placement-by-return/text/0000-placement-by-return.md">linked RFC PR</a> contains a lot more information on the proposed mechanism, which I suspect is (part of) why the MCP is so light on detail.</p>



<a name="202941107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202941107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202941107">(Jul 05 2020 at 22:31)</a>:</h4>
<p>I've only skimmed it now (I read it more thoroughly in the past) but I believe: no, the kind of details I would expect from a compiler MCP working towards implementing placement are entirely absent. There is a great deal of detail about the proposed language feature (which ought to be a lang team MCP as noted earlier), but the challenges of generating code that adheres to the "guaranteed copy elision" wish list are not even mentioned, let alone addressed.</p>



<a name="202950251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Add%20placement%20by%20return%20%28GCE%2C%20unsized%20retu%20compiler-team%23330/near/202950251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Add.20placement.20by.20return.20(GCE.2C.20unsized.20retu.20compiler-team.23330.html#202950251">(Jul 06 2020 at 03:15)</a>:</h4>
<p>(no real argument here. Then again, I'm not exactly certain how much detail is expected from the MCP and how much is left to be discussed here; I've mostly stuck to the libs part of things.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>